function CreateFolder(){
  html = '<div style="text-align:center; padding: 20px;"><label>Create Folder : </label>'+
         '<input type="text" name="cfolder" id="cfoldertxt" size="20" /></div>';
  showDialog("Create Folder", html, {
    "Close": function() {
      $(this).dialog('close');
    },
    
    "Create Folder": function() {
      if(!$("#cfoldertxt").val().match(/^\w?[\w \._]*$/)) {
        alert("Please enter valid folder name!");
        return;
      }
      var currentdir = ($("#currentdir").val() == "/") ? "/" : $("#currentdir").val() + "/";
      var cfdir = $("#cfoldertxt").val();
      $.ajax({
        type: "get",
        url: "modules/create_folder/create_folder.php",
        data: "dir=" + currentdir + cfdir + "&t=" + new Date(),
        dataType: "text",
        success: function(data) {
          $dialog.dialog('close');
          $dialog.remove();
          Browse($("#currentdir").val());
          alert(data);
        }
      });
    }
  });      
}
